home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cdity
/
ModeProSrc.lha
/
Daemon
/
MPPalettePrefs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-07-20
|
1KB
|
48 lines
#include "mp.h"
#include <prefs/palette.h>
#include <prefs/prefhdr.h>
extern struct MPSem *MPSem;
BOOL LoadPalettePrefs(void)
{
struct IFFHandle *iff;
struct StoredProperty *sp;
LONG error=0;
MPSem->PPrefsSet=FALSE;
if(iff=AllocIFF())
{
if(iff->iff_Stream = Open ("env:sys/palette.prefs",MODE_OLDFILE))
{
InitIFFasDOS(iff);
if(!(error=OpenIFF(iff,IFFF_READ)) )
{
if (!(error=PropChunk(iff,ID_PREF,ID_PALT)))
{
if(!(error=StopOnExit(iff,ID_PREF,ID_FORM)))
{
if((error=ParseIFF(iff,IFFPARSE_SCAN))>-3)
{
if(sp=FindProp(iff,ID_PREF,ID_PALT))
{
MPSem->PPrefs=*(struct PalettePrefs *)sp->sp_Data;
MPSem->PPrefsSet=TRUE;
}
}/* end ParseIFF if */
}
} /* End Prop MPPR */
CloseIFF(iff);
}
Close(iff->iff_Stream);
}
FreeIFF(iff);
}
if(error<0)
return(FALSE);
return(TRUE);
}